	format	MS COFF
	extrn	___bb_appstub_appstub
	extrn	___bb_audio_audio
	extrn	___bb_blitz_blitz
	extrn	___bb_cal3d_cal3d
	extrn	___bb_calb3d_calb3d
	extrn	___bb_d3d7max2d_d3d7max2d
	extrn	___bb_d3d9max2d_d3d9max2d
	extrn	___bb_data_data
	extrn	___bb_directsoundaudio_directsoundaudio
	extrn	___bb_eventqueue_eventqueue
	extrn	___bb_freeaudioaudio_freeaudioaudio
	extrn	___bb_freejoy_freejoy
	extrn	___bb_freeprocess_freeprocess
	extrn	___bb_freetypefont_freetypefont
	extrn	___bb_gnet_gnet
	extrn	___bb_loader_loader
	extrn	___bb_macos_macos
	extrn	___bb_map_map
	extrn	___bb_maxlua_maxlua
	extrn	___bb_maxutil_maxutil
	extrn	___bb_minib3d_minib3d
	extrn	___bb_oggloader_oggloader
	extrn	___bb_openalaudio_openalaudio
	extrn	___bb_tgaloader_tgaloader
	extrn	___bb_timer_timer
	extrn	___bb_wavloader_wavloader
	extrn	_bbEnd
	extrn	_bbMilliSecs
	extrn	_bbNullObject
	extrn	_bbObjectNew
	extrn	_bbOnDebugEnterScope
	extrn	_bbOnDebugEnterStm
	extrn	_bbOnDebugLeaveScope
	extrn	_bbStringClass
	extrn	_bbStringConcat
	extrn	_bbStringFromInt
	extrn	_brl_bank_LoadBank
	extrn	_brl_blitz_DebugStop
	extrn	_brl_blitz_NullObjectError
	extrn	_brl_graphics_Flip
	extrn	_brl_polledinput_KeyDown
	extrn	_brl_polledinput_KeyHit
	extrn	_c3d_cal3d_Delta
	extrn	_c3d_calb3d_CB3DModel
	extrn	_c3d_loader_LoadXMLAnimation
	extrn	_c3d_loader_LoadXMLMaterial
	extrn	_c3d_loader_LoadXMLMesh
	extrn	_c3d_loader_LoadXMLMorphAnimation
	extrn	_c3d_loader_LoadXMLSkeleton
	extrn	_sidesign_minib3d_CreateCamera
	extrn	_sidesign_minib3d_CreateLight
	extrn	_sidesign_minib3d_Graphics3D
	extrn	_sidesign_minib3d_MoveEntity
	extrn	_sidesign_minib3d_PositionEntity
	extrn	_sidesign_minib3d_RenderWorld
	extrn	_sidesign_minib3d_Text
	extrn	_sidesign_minib3d_TurnEntity
	public	__bb_main
	section	"code" code
__bb_main:
	push	ebp
	mov	ebp,esp
	sub	esp,48
	push	ebx
	push	esi
	cmp	dword [_143],0
	je	_144
	mov	eax,0
	pop	esi
	pop	ebx
	mov	esp,ebp
	pop	ebp
	ret
_144:
	mov	dword [_143],1
	mov	dword [ebp-4],0
	mov	dword [ebp-8],0
	mov	dword [ebp-12],0
	mov	dword [ebp-16],0
	mov	dword [ebp-20],_bbNullObject
	mov	dword [ebp-24],_bbNullObject
	mov	dword [ebp-28],_bbNullObject
	fldz
	fstp	dword [ebp-32]
	mov	dword [ebp-36],0
	mov	dword [ebp-40],0
	mov	dword [ebp-44],0
	mov	eax,ebp
	push	eax
	push	_125
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	call	___bb_blitz_blitz
	call	___bb_minib3d_minib3d
	call	___bb_cal3d_cal3d
	call	___bb_calb3d_calb3d
	call	___bb_loader_loader
	call	___bb_appstub_appstub
	call	___bb_audio_audio
	call	___bb_d3d7max2d_d3d7max2d
	call	___bb_d3d9max2d_d3d9max2d
	call	___bb_data_data
	call	___bb_directsoundaudio_directsoundaudio
	call	___bb_eventqueue_eventqueue
	call	___bb_freeaudioaudio_freeaudioaudio
	call	___bb_freetypefont_freetypefont
	call	___bb_gnet_gnet
	call	___bb_map_map
	call	___bb_maxlua_maxlua
	call	___bb_maxutil_maxutil
	call	___bb_oggloader_oggloader
	call	___bb_openalaudio_openalaudio
	call	___bb_tgaloader_tgaloader
	call	___bb_timer_timer
	call	___bb_wavloader_wavloader
	call	___bb_freejoy_freejoy
	call	___bb_freeprocess_freeprocess
	call	___bb_macos_macos
	push	_37
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-4],1024
	mov	dword [ebp-8],768
	mov	dword [ebp-12],0
	mov	dword [ebp-16],2
	push	_43
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	-1
	push	60
	push	dword [ebp-16]
	push	dword [ebp-12]
	push	dword [ebp-8]
	push	dword [ebp-4]
	call	_sidesign_minib3d_Graphics3D
	add	esp,24
	push	_44
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_bbNullObject
	call	_sidesign_minib3d_CreateCamera
	add	esp,4
	mov	dword [ebp-20],eax
	push	_46
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	0
	push	-1049624576
	push	1092616192
	push	0
	push	dword [ebp-20]
	call	_sidesign_minib3d_PositionEntity
	add	esp,20
	push	_47
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_bbNullObject
	push	1
	call	_sidesign_minib3d_CreateLight
	add	esp,8
	mov	dword [ebp-24],eax
	push	_49
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_c3d_calb3d_CB3DModel
	call	_bbObjectNew
	add	esp,4
	mov	dword [ebp-28],eax
	push	_51
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [_c3d_cal3d_Delta]
	cmp	ebx,_bbNullObject
	jne	_53
	call	_brl_blitz_NullObjectError
_53:
	fld	dword [_145]
	fstp	dword [ebx+8]
	push	_55
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_57
	call	_brl_blitz_NullObjectError
_57:
	push	_25
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLSkeleton
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+48]
	add	esp,8
	push	_58
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_60
	call	_brl_blitz_NullObjectError
_60:
	push	_26
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLMesh
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+84]
	add	esp,8
	push	_61
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_63
	call	_brl_blitz_NullObjectError
_63:
	mov	esi,dword [ebp-28]
	cmp	esi,_bbNullObject
	jne	_65
	call	_brl_blitz_NullObjectError
_65:
	push	dword [esi+8]
	push	_27
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLAnimation
	add	esp,8
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+68]
	add	esp,8
	push	_66
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_68
	call	_brl_blitz_NullObjectError
_68:
	push	_28
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLMorphAnimation
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+72]
	add	esp,8
	push	_69
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_71
	call	_brl_blitz_NullObjectError
_71:
	push	_1
	push	0
	push	_29
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLMaterial
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+76]
	add	esp,16
	push	_72
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_74
	call	_brl_blitz_NullObjectError
_74:
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+88]
	add	esp,4
	push	_75
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_77
	call	_brl_blitz_NullObjectError
_77:
	push	0
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+64]
	add	esp,8
	push	_78
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_80
	call	_brl_blitz_NullObjectError
_80:
	push	0
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+52]
	add	esp,8
	push	_81
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	fldz
	fstp	dword [ebp-32]
	push	_83
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbMilliSecs
	mov	dword [ebp-36],eax
	push	_85
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-40],0
	push	_87
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-44],0
	push	_89
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	jmp	_30
_32:
	mov	eax,ebp
	push	eax
	push	_123
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_90
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [_c3d_cal3d_Delta]
	cmp	ebx,_bbNullObject
	jne	_92
	call	_brl_blitz_NullObjectError
_92:
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+52]
	add	esp,4
	push	_93
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	13
	call	_brl_polledinput_KeyHit
	add	esp,4
	cmp	eax,0
	je	_94
	mov	eax,ebp
	push	eax
	push	_96
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_95
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_brl_blitz_DebugStop
	call	dword [_bbOnDebugLeaveScope]
_94:
	push	_97
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	87
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	83
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-48],ebx
	fild	dword [ebp+-48]
	sub	esp,4
	fstp	dword [esp]
	push	0
	push	68
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	65
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-48],ebx
	fild	dword [ebp+-48]
	sub	esp,4
	fstp	dword [esp]
	push	dword [ebp-20]
	call	_sidesign_minib3d_MoveEntity
	add	esp,16
	push	_98
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	0
	push	0
	push	37
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	39
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-48],ebx
	fild	dword [ebp+-48]
	sub	esp,4
	fstp	dword [esp]
	push	40
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	38
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-48],ebx
	fild	dword [ebp+-48]
	sub	esp,4
	fstp	dword [esp]
	push	dword [ebp-20]
	call	_sidesign_minib3d_TurnEntity
	add	esp,20
	push	_99
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	189
	call	_brl_polledinput_KeyDown
	add	esp,4
	cmp	eax,0
	je	_100
	mov	eax,ebp
	push	eax
	push	_102
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_101
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	fld	dword [ebp-32]
	fsub	dword [_146]
	fstp	dword [ebp-32]
	call	dword [_bbOnDebugLeaveScope]
_100:
	push	_103
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	187
	call	_brl_polledinput_KeyDown
	add	esp,4
	cmp	eax,0
	je	_104
	mov	eax,ebp
	push	eax
	push	_106
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_105
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	fld	dword [ebp-32]
	fadd	dword [_147]
	fstp	dword [ebp-32]
	call	dword [_bbOnDebugLeaveScope]
_104:
	push	_107
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	esi,dword [ebp-28]
	cmp	esi,_bbNullObject
	jne	_109
	call	_brl_blitz_NullObjectError
_109:
	mov	ebx,dword [_c3d_cal3d_Delta]
	cmp	ebx,_bbNullObject
	jne	_111
	call	_brl_blitz_NullObjectError
_111:
	fld	dword [ebx+24]
	fdiv	dword [_148]
	sub	esp,4
	fstp	dword [esp]
	push	esi
	mov	eax,dword [esi]
	call	dword [eax+96]
	add	esp,8
	push	_112
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_sidesign_minib3d_RenderWorld
	push	_113
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	add	dword [ebp-40],1
	push	_114
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbMilliSecs
	sub	eax,dword [ebp-36]
	cmp	eax,1000
	jl	_115
	mov	eax,ebp
	push	eax
	push	_119
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_116
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbMilliSecs
	mov	dword [ebp-36],eax
	push	_117
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	eax,dword [ebp-40]
	mov	dword [ebp-44],eax
	push	_118
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-40],0
	call	dword [_bbOnDebugLeaveScope]
_115:
	push	_120
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	dword [ebp-44]
	call	_bbStringFromInt
	add	esp,4
	push	eax
	push	_33
	call	_bbStringConcat
	add	esp,8
	push	eax
	push	0
	push	0
	call	_sidesign_minib3d_Text
	add	esp,12
	push	_121
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_34
	push	20
	push	0
	call	_sidesign_minib3d_Text
	add	esp,12
	push	_122
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	-1
	call	_brl_graphics_Flip
	add	esp,4
	call	dword [_bbOnDebugLeaveScope]
_30:
	push	27
	call	_brl_polledinput_KeyDown
	add	esp,4
	cmp	eax,0
	je	_32
_31:
	push	_124
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbEnd
	mov	ebx,0
	jmp	_35
_35:
	call	dword [_bbOnDebugLeaveScope]
	mov	eax,ebx
	pop	esi
	pop	ebx
	mov	esp,ebp
	pop	ebp
	ret
	section	"data" data writeable align 8
	align	4
_143:
	dd	0
_126:
	db	"demo1",0
_127:
	db	"width",0
_128:
	db	"i",0
_129:
	db	"height",0
_130:
	db	"depth",0
_131:
	db	"mode",0
_132:
	db	"cam",0
_133:
	db	":TCamera",0
_134:
	db	"light",0
_135:
	db	":TLight",0
_136:
	db	"calmodel",0
_137:
	db	":CB3DModel",0
_138:
	db	"anim_time",0
_139:
	db	"f",0
_140:
	db	"old_ms",0
_141:
	db	"renders",0
_142:
	db	"fps",0
	align	4
_125:
	dd	1
	dd	_126
	dd	2
	dd	_127
	dd	_128
	dd	-4
	dd	2
	dd	_129
	dd	_128
	dd	-8
	dd	2
	dd	_130
	dd	_128
	dd	-12
	dd	2
	dd	_131
	dd	_128
	dd	-16
	dd	2
	dd	_132
	dd	_133
	dd	-20
	dd	2
	dd	_134
	dd	_135
	dd	-24
	dd	2
	dd	_136
	dd	_137
	dd	-28
	dd	2
	dd	_138
	dd	_139
	dd	-32
	dd	2
	dd	_140
	dd	_128
	dd	-36
	dd	2
	dd	_141
	dd	_128
	dd	-40
	dd	2
	dd	_142
	dd	_128
	dd	-44
	dd	0
_38:
	db	"$BMXPATH/mod/c3d.mod/cal3d.mod/DemoCal3d/demo1.bmx",0
	align	4
_37:
	dd	_38
	dd	8
	dd	1
	align	4
_43:
	dd	_38
	dd	10
	dd	1
	align	4
_44:
	dd	_38
	dd	12
	dd	1
	align	4
_46:
	dd	_38
	dd	13
	dd	1
	align	4
_47:
	dd	_38
	dd	15
	dd	1
	align	4
_49:
	dd	_38
	dd	17
	dd	1
	align	4
_51:
	dd	_38
	dd	18
	dd	1
	align	4
_145:
	dd	0x41f00000
	align	4
_55:
	dd	_38
	dd	19
	dd	1
	align	4
_25:
	dd	_bbStringClass
	dd	2147483647
	dd	8
	dw	99,117,98,101,46,120,115,102
	align	4
_58:
	dd	_38
	dd	20
	dd	1
	align	4
_26:
	dd	_bbStringClass
	dd	2147483647
	dd	8
	dw	99,117,98,101,46,120,109,102
	align	4
_61:
	dd	_38
	dd	22
	dd	1
	align	4
_27:
	dd	_bbStringClass
	dd	2147483647
	dd	8
	dw	99,117,98,101,46,120,97,102
	align	4
_66:
	dd	_38
	dd	23
	dd	1
	align	4
_28:
	dd	_bbStringClass
	dd	2147483647
	dd	8
	dw	99,117,98,101,46,120,112,102
	align	4
_69:
	dd	_38
	dd	25
	dd	1
	align	4
_1:
	dd	_bbStringClass
	dd	2147483647
	dd	0
	align	4
_29:
	dd	_bbStringClass
	dd	2147483647
	dd	8
	dw	99,117,98,101,46,120,114,102
	align	4
_72:
	dd	_38
	dd	26
	dd	1
	align	4
_75:
	dd	_38
	dd	27
	dd	1
	align	4
_78:
	dd	_38
	dd	28
	dd	1
	align	4
_81:
	dd	_38
	dd	32
	dd	1
	align	4
_83:
	dd	_38
	dd	35
	dd	1
	align	4
_85:
	dd	_38
	dd	36
	dd	1
	align	4
_87:
	dd	_38
	dd	37
	dd	1
	align	4
_89:
	dd	_38
	dd	39
	dd	1
	align	4
_123:
	dd	3
	dd	0
	dd	0
	align	4
_90:
	dd	_38
	dd	40
	dd	2
	align	4
_93:
	dd	_38
	dd	41
	dd	2
	align	4
_96:
	dd	3
	dd	0
	dd	0
	align	4
_95:
	dd	_38
	dd	41
	dd	28
	align	4
_97:
	dd	_38
	dd	44
	dd	2
	align	4
_98:
	dd	_38
	dd	45
	dd	2
	align	4
_99:
	dd	_38
	dd	47
	dd	2
	align	4
_102:
	dd	3
	dd	0
	dd	0
	align	4
_101:
	dd	_38
	dd	47
	dd	29
	align	4
_146:
	dd	0x3dcccccd
	align	4
_103:
	dd	_38
	dd	48
	dd	2
	align	4
_106:
	dd	3
	dd	0
	dd	0
	align	4
_105:
	dd	_38
	dd	48
	dd	30
	align	4
_147:
	dd	0x3dcccccd
	align	4
_107:
	dd	_38
	dd	51
	dd	2
	align	4
_148:
	dd	0x41f00000
	align	4
_112:
	dd	_38
	dd	52
	dd	2
	align	4
_113:
	dd	_38
	dd	53
	dd	2
	align	4
_114:
	dd	_38
	dd	56
	dd	2
	align	4
_119:
	dd	3
	dd	0
	dd	0
	align	4
_116:
	dd	_38
	dd	57
	dd	3
	align	4
_117:
	dd	_38
	dd	58
	dd	3
	align	4
_118:
	dd	_38
	dd	59
	dd	3
	align	4
_120:
	dd	_38
	dd	62
	dd	2
	align	4
_33:
	dd	_bbStringClass
	dd	2147483647
	dd	5
	dw	70,80,83,58,32
	align	4
_121:
	dd	_38
	dd	63
	dd	2
	align	4
_34:
	dd	_bbStringClass
	dd	2147483647
	dd	14
	dw	43,47,45,32,116,111,32,97,110,105,109,97,116,101
	align	4
_122:
	dd	_38
	dd	66
	dd	2
	align	4
_124:
	dd	_38
	dd	69
	dd	1
